package com.itheima.web;

import com.itheima.servcie.BaiduService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/baidu")
public class BaiduController {
    @Autowired
    private BaiduService baiduService;

    /**
     * 上报地理位置
     * @param longitude
     * @param latitude
     * @param addrStr
     * @return
     */
    @PostMapping("/location")
    private ResponseEntity getLocation(Double longitude, Double latitude, String addrStr){
        baiduService.saveLocation(longitude, latitude, addrStr);
        return ResponseEntity.ok(null);
    }
}
